
#include "S_8_Electricity_doGet.h"
#include "mi_iid_define.h"
#include "property_decoder.h"
#include "section_define.h"
#include "main.h"  


extern uint8_t  g_uNo1RegList[PBS_NO1REGSIZE];

/**
 * 格式: property_value_new_integer(整数)　
 * 取值: 最小值: 0, 最大值: 9999, 步长: 1
 */
static void P_8_5_TimeCount_doGet(property_operation_t *o)
{
	InDoorBusReg RegSection1 = {0};
	static uint16_t Temp = 0;
#if 	PROPERTY_TYPE
	RegSection1.V8 = GetPbsRegValue(0x001A);
//	if(RegSection1.BIT1.bit7)
	{
		Temp = (((g_uNo1RegList[0x1A])<<8) | (g_uNo1RegList[0x19])) & 0x7FFF;
		property_value_new_integer(&o->value,Temp);	
	}
	
#else	
    o->value.format = PROPERTY_FORMAT_NUMBER;
	o->value.data.number.type = DATA_NUMBER_INTEGER;
	o->value.data.number.value.integerValue = 8888;   // TODO: 这里需要读到属性真正的值
#endif
    
}

void S_8_Electricity_doGet(property_operation_t *o)
{
    switch (o->piid)
    {
        case PIID_8_5_TimeCount:
            P_8_5_TimeCount_doGet(o);
            break;

        default:
            o->code = OPERATION_ERROR_VALUE;
            break;
    }
}
